import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server:{
    proxy:{ //代理服务器的配置
      '/api-dev': {
        target: 'http://localhost:8080/',//target: 'http://localhost:8080/'
        changeOrigin: true, //开启跨域请求(支持)
        rewrite: (path) => path.replace(/^\/api-dev/, '')
      }
    }
  }
})
